<template>
    <div class="da">
        <div class="homecontent">
            <div class="header">
                <span>sort by: Default proce <i class="iconfont icon-long-arrow-rt"></i></span>
            </div>
            <div class="left">
                <p>PRICE:</p>
                <ul>
                    <li><a href="javascript:;">All</a></li>
                    <li><a href="javascript:;">0.00 - 100</a></li>
                    <li><a href="javascript:;">100.00 - 500.00</a></li>
                    <li><a href="javascript:;">500.00 - 1000.00</a></li>
                    <li><a href="javascript:;">1000.00 - 5000.00</a></li>
                </ul>
            </div>
            <div class="right">
                <dl v-for="(val,index) in listImg" :key='index'>
                    <dt><img :src="'../static/' + val.productImage" alt=""></dt>
                    <dd>
                        <p>{{val.productName}}</p>
                        <p>${{val.salePrice}}</p>
                        <p><button>加入购物车</button></p>
                    </dd>
                </dl>
                
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    name:'homeContent',
    data: function(){
        return {
            listImg:{}
        }
    },
    mounted:function(){
        axios.get("/goods/list?page=1&pageSize=8&sort=-1&priceLevel=all").then((res)=>{
                var data = res.data.result.list;
                console.log(data);
                this.listImg = data;
        });
    }
}
</script>

<style scoped lang='less'>
.da{
    width: 100%;
    background: #f5f7fc;
}
    .homecontent{
        width: 1310px;
        min-height: 560px;
        margin: 0 auto;
        background: #f5f7fc;
        overflow: hidden;
        .header{
            width: 1260px;
            float: left;
            height: 55px;
            margin: 60px 25px 30px;
            background: #fff;
            span{
                float: right;
                line-height: 55px;
            }
        }
        .left{
            width: 240px;
            height: 350px;
            margin-left: 25px;
            float: left;
            p{
                line-height: 45px;
                font-weight: bold;
            }
            ul{
                li{
                    line-height: 45px;
                }
                li:hover a{
                    padding-left: 7px; 
                    border-left: 1px solid #ee7a23;
                }
            }
        }
        .right{
            width: 1025px;
            float:right;
            margin-right: 15px;
            dl{
                width: 23%;
                margin: 0 10px 20px;
                height: 405px;
                float: left;
                background: #fff;
                dt{
                    img{
                        width: 100%;
                        height: 100%;
                    }
                }
                dd{
                    p{
                        padding: 10px;
                        &:first-child{
                            line-height: 30px;
                            font-weight: bold;
                        }
                        &:nth-child(2){
                            margin-top: 20px;
                            color: #d1434a;
                        }
                        &:last-child{
                            margin-top: 8px;
                            button{
                                width: 215px;
                                height: 40px;
                                border:1px solid #d1434a;
                                background: #fff;
                                font-size: 16px;
                                font-weight: bold;
                                color: #d1434a;
                            }
                        }
                    }
                }
            }
        }
    }
</style>
